﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using System.Data;

namespace QLHH
{
    /// <summary>
    public partial class LoginWindow : Window
    {
        public LoginWindow()
        {
            InitializeComponent();
        }

        private void Expander_Expanded(object sender, RoutedEventArgs e)
        {
            this.Height = 380;
        }

        private void Expander_Collapsed(object sender, RoutedEventArgs e)
        {
            this.Height = 280;
        }

        private void btDongY_Click(object sender, RoutedEventArgs e)
        {
            Users usr = new Users();
            string user = cbTenNguoiDung.Text;
            string pass = pbMatKhau.Password;
            DataTable dt = usr.DanhSachUsers(user, pass);
            if (dt.Rows.Count > 0)
            {
                this.Close();
            }
            else
            {
                MessageBoxResult result = MessageBox.Show("Sai Thông Tin ?", "Thông Báo", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }

        private void btThoat_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }

    }
}